-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STCOR-942: migrate away from reading stripes-config::okapi.url #1589
Conversation
Bigtest Unit Test Results189 tests ±0 184 ✅ ±0 6s ⏱️ ±0s Results for commit 90bcd74. ± Comparison against base commit c800a5a. This pull request removes 5 and adds 3 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/loginServices.js
Outdated
if (store.getState().okapi.authnUrl) { | ||
return fetch(store.getState().okapi.authnUrl, { | ||
method: 'POST', | ||
body: new URLSearchParams({ | ||
...data, | ||
'grant_type': 'password', | ||
'client_id': okapi.clientId, | ||
'client_secret': okapi.clientSecret, | ||
'client_id': store.getState()?.okapi?.clientId, | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact this whole conditional is irrelevant, left-over from a very early implementation. Now, when okapi.authnUrl
is present, we redirect to Keycloak to authenticate, meaning we don't need a conditional at all because requestLogin
is only called in legacy context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thank you!
|
Fetch `tenant` from state instead of from `stripes-config`. This resolves a bug introduced in #1589 that left a dangling reference to `this.tenant` that was no longer populated. Refs STCOR-942
…alstorage on login screen (#1594) - Revert login control changes from #1589 so localstorage is not used determine Tenant ID and Okapi URL values. - Previously, login was looking at props passed in, which would default to localstorage. This makes builds unable to run with different tenant IDs or Okapi URL values without manually clearing localstorage in the browser.
Refs STCOR-942.